package com.hwzn.module.front.controller.business;

import java.io.IOException;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import com.hwzn.module.business.service.OcrService;
import com.hwzn.module.core.vos.business.OcrAnalysisReqVO;

import cn.hutool.core.io.IoUtil;

/**
 * ocrAnalysis
 *
 * @author jiaobo
 * @date Created in 2024/5/21 17:02
 * @company hw
 **/
@RestController
@RequestMapping("/ocr")
public class OcrController {

    @Resource
    private OcrService ocrService;

    @PostMapping("/ocrAnalysis")
    public Object ocrAnalysis(OcrAnalysisReqVO reqVO) throws IOException {
        MultipartFile file = reqVO.getFile();
        return ocrService.ocrAnalysis
                (IoUtil.readBytes(file.getInputStream()));
    }

}
